From 9e5e0eb8408c37b42411c6686c36eccd2426e7fd Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 20 Jan 2010 09:51:38 +0000 Subject: [PATCH] xend: Fix 20825:49a2c1069e14 Converting an Python Int, sizeof(long) already returns byte length rather than bit length so do not divide-by-8. Signed-off-by: Keir Fraser --- tools/python/xen/lowlevel/xc/xc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c index 996e1b4ae2..1932758090 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -933,7 +933,7 @@ static PyObject *pyxc_hvm_build(XcObject *self, if ( PyInt_Check(vcpu_avail_handle) ) { unsigned long v = PyInt_AsLong(vcpu_avail_handle); - for ( i = 0; i < sizeof(long)/8; i++ ) + for ( i = 0; i < sizeof(long); i++ ) vcpu_avail[i] = (uint8_t)(v>>(i*8)); } else if ( PyLong_Check(vcpu_avail_handle) ) -- 2.30.2